package com.qk.common.util;

import java.util.Random;

/**
 * @Author:gzc
 * @Date: 2025/10/09 18:58
 * @Description:
 */
public class SmsUtils {
    /**
     * 获取验证码随机数
     *
     * @param length
     * @return
     */
    public static String getRandomCode(int length) {
        String sources = "0123456789";
        Random random = new Random();
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < length; j++) {
            sb.append(sources.charAt(random.nextInt(9)));
        }
        return sb.toString();
    }
}
